Time-stacking method for dynamic simulations

ABSTRACT

A time-stacking method is disclosed. The time-stacking method simulates dynamics so as to obtain time-domain trajectories which correspond to a disturbance or event. The method includes providing a model for the system. The model includes differential equations and algebraic equations. The method also includes solving the differential equations and the algebraic equations over a predetermined number of time steps simultaneously using an implicit integration scheme.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to U.S. Provisional Application Ser. No. 61/909,659, filed Nov. 27, 2013, titled “PARALLEL TIME-STACKING METHOD FOR LARGE-SCALE DYNAMIC SIMULATIONS,” hereby incorporated by reference in its entirety for all of its teachings.

STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH OR DEVELOPMENT

This invention was made with Government support under Contract DE-AC05-76RL01830 awarded by the U.S. Department of Energy. The Government has certain rights in the invention.

TECHNICAL FIELD

This invention relates to dynamic simulations. More specifically, this invention relates to a time-stacking method of simulating dynamics of a system by solving multiple time steps simultaneously using an implicit integration scheme.

BACKGROUND

Dynamic simulation plays a significant role in secure operations and planning of systems. In power networks, dynamic simulations solve a large set of differential algebraic equations for thousands of times that describe the electro-mechanical interaction of generators as well as power electronic devices and their controllers. The solutions of these equations determine the time-series trajectory of a power grid when subject to disturbances such as short-circuit faults, generator tripping, line switching or other severe contingencies.

The dynamics of a power system can be represented by a set of first-order differential equations (1a) and algebraic equations (1b):

$\begin{matrix} \left\{ \begin{matrix} {\overset{.}{x} = {f\left( {x,y} \right)}} \\ {0 = {{g\left( {x,y} \right)}\left( {1b} \right)}} \end{matrix} \right. & \left( {1a} \right) \end{matrix}$

Where x represents a vector of state variables describing generator or load dynamics (e.g., generator rotor angle, rotor speed, sub-transient voltages or flux) and y represents a vector of algebraic variables (e.g., voltages from all or selected buses in the network and the current injections from generators or loads, which can be expressed as magnitudes and phase angles, or real and imaginary parts).

A major obstacle of introducing dynamic simulation into online security assessment is the computationally intensive time-domain solution of numerous differential and algebraic equations involved in modeling the system dynamics and network. The traditional method for dynamic simulation is serial in nature and can only solve the network dynamics one step after another. This process is very slow for a larger-scale power network model, such as the Western or Eastern Interconnection in North America.

A common serial dynamic simulation method is the partitioned or alternating solution. The partitioned-solution method is predominately used in industrial systems or commercial simulation software programs. In this method, the differential equation set of (1a) is discretized and then solved for x_(γ) (x at time step γ). The algebraic equation set (1b) is then solved for y_(γ).

The partitioned-solution scheme includes an explicit integration method and an implicit integration for solving the equations, as shown in FIG. 1.

A. Partitioned Method with Explicit Integration

Using an explicit integration method, equation 1(a) is converted into an algebraic equation set

x _(γ) =F(x _(γ−1) ,y _(γ−1)).  (2)

which can be used to solve for x_(γ) using the previous step values. The value of x_(γ) is used to solve (3) for y_(γ).

0=g(x _(γ) ,y _(γ)).  (3)

B. Partitioned Method with Implicit Integration

Using an implicit integration method, equation (1a) is converted into an algebraic equation set

x _(γ) =F(x _(γ) ,y _(γ)).  (4)

The initial guess of x_(γ) can be obtained based on x_(γ−1) and y_(γ−1) using any explicit integration formula. The value of y_(γ) is then used in equation (4) to obtain x_(γ), which is used in equation (3) to solve y_(γ). This process will be repeated until the solution is converged.

SUMMARY

The present invention describes methods of solving multiple time steps of system dynamics simultaneously so that the total computation time may be significantly reduced using parallel computing techniques. The method uses a single set of equations that models multiple time intervals simultaneously, which includes applying high-performance computing to solve the equations simultaneously in parallel.

In one embodiment of the present invention, a time-stacking method is disclosed. The time-stacking method simulates dynamics of a system to obtain time-domain trajectories of the system that correspond to a disturbance or event. The method includes a model for testing the system. The model includes differential equations and algebraic equations. The method also includes solving the differential equations and the algebraic equations over a predetermined number of time steps simultaneously using an implicit integration scheme. The method may also include applying a numerical solver to compute a final result of the equations. A supercomputer or high-performance computer may be applied for solving the equations simultaneously in parallel.

The implicit integration scheme includes, but is not limited to, at least one of the following: Backward Euler, Trapezoidal, Runge-Kutta, Newton, and Dishonest Newton.

The differential equations may represent vectors of state variables, and the algebraic equations may represent vectors of algebraic variables.

The vectors of state variables include, but are not limited to, generator and its controller dynamics. The generator dynamics may include rotor angle and generator speed.

The vectors of algebraic variables include, but are not limited to, voltages from all or selected buses in the network and the current injections from generators or loads, which can be expressed as magnitudes and phase angles, or real and imaginary parts.

In one embodiment, the time steps comprise intervals of at least 1 microsecond. The time steps of intervals may vary over a range of at least 1 microsecond so as to obtain a calculation that corresponds to the disturbance or event.

In another embodiment of the present invention, a method of simulating power system dynamics of a system so as to obtain time-domain trajectories which correspond to a disturbance or event is disclosed. The method includes providing a model for the system. The model includes differential equations and algebraic equations. The method further includes solving the differential equations and the algebraic equations over a predetermined number of time steps simultaneously using an implicit integration scheme. The method also includes applying a numerical solver to compute a final result of the equations, and applying a supercomputer or high-performance computer for solving the equations simultaneously.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a flow chart of a prior art partitioned-solution method using implicit or explicit methods, for simulating dynamics of a system.

FIG. 2 is a flow chart of a time-stacking method of simulating dynamics of a system so as to obtain time-domain trajectories which correspond to a disturbance or event, in accordance with one embodiment of the present invention.

FIG. 3A shows a Butcher tableau for an explicit Runge-Kutta integration method.

FIG. 3B shows a Butcher tableau for an implicit Runge-Kutta integration method.

FIG. 4 shows a Butcher tableau for a classical explicit Runge-Kutta integration method.

FIGS. 5A-5C shows stability domains for (A) Forward Euler, (B) Backward Euler, and (C) Trapezoidal integration methods.

FIG. 6 is a table showing the variables used in the code and the corresponding notation for a model for the system with a modified Euler integration method.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

The present invention relates to time-stacking methods of solving multiple time steps of system dynamic performance simultaneously by using an implicit integration scheme. The present invention solves a single set of differential and algebraic equations simultaneously over a predetermined number of time steps. The parallel time-stacking methods solve multiple time steps simultaneously. As a result, the time-stacking methods of the present invention significantly speed up simulations of system performance.

In the simultaneous time-stacking method of the present invention, as shown in FIG. 2, equation (1a) is converted into a set of algebraic equations, which are lumped together with equation (1b) to form a single larger algebraic equations set. Variables X_(γ and) y_(γ) are solved simultaneously over a predetermined number of times steps using an implicit integration scheme. As an example, writing equation (4) in the form of

0=H(x _(γ) ,y _(γ)),  (5)

and then combining equation (5) and equation (3), a single set of algebraic equations can be obtained. As one example, Newton's method can be used to solve the algebraic equation set, requiring the construction and solution at each iteration of the Jacobian matrix

$\begin{matrix} {J = {\begin{bmatrix} J_{Fx} & J_{Fy} \\ J_{gx} & J_{gy} \end{bmatrix}.}} & (6) \end{matrix}$

No matter which scheme is used, those non-linear algebraic equations need to be solved using, for example, Gauss or Newton type procedures. Dishonest Newton or very dishonest Newton methods are often used in industrial software to increase computation speed. When Newton-like method is used, linear solvers are included as well.

Mathematic Formulation of Multi-Machine System with Classical Model

When generators are represented using the classical model, the equations of motion for generator i in per unit are:

$\begin{matrix} \left\{ \begin{matrix} {{\overset{.}{\delta}}_{(i)} = {\omega_{b}\omega_{(i)}}} \\ {{\overset{.}{\omega}}_{(i)} = {\frac{1}{2\; H_{(i)}}\left( {P_{m{(i)}} - P_{e{(i)}} - {D_{(i)}\omega_{(i)}}} \right)\left( {7b} \right)}} \end{matrix} \right. & \left( {7a} \right) \end{matrix}$

where ω_((i)) is the per unit speed deviation for generator i, δ_((i)) is the angular position of the rotor of generator i in electrical radians with respect to a synchronously rotating reference, H_((i)) is the inertia constant of generator i using system base VA², D_((i)) is the damping factor or coefficient of generator i in pu torque/pu speed deviation, P_(m(i)) is the mechanical power input of generator i, and ω_(b) is the base rotor electrical speed in radians per second. In this case, state variables in (1) only include rotor speed and angle, i.e.,

x=[δ ₍₁₎,ω₍₁₎, . . . ,δ_((i)),ω_((i)), . . . ,δ_((n)),ω_((n))]^(T),  (8)

where n is the number of generators.

Using the classical model to study the transient stability for a multi-machine system, it is often assumed:

1) Mechanical power input (P_(m(i))) is constant.

2) The mechanical rotor angle of a machine coincides with the angle of the voltage behind the transient reactance.

3) The network is assumed to be in the sinusoidal stead state.

4) Load is represented by the passive impedances, i.e., the dynamics of load is ignored.

Therefore, let Y″ (with a dimension equal to m by m) denote the nodal admittance matrix of an m-bus system comprised of n generator buses and m−n load buses. One can add machine internal buses and include load impedance into the admittance matrix, resulting in an extended Y-bus—Y′ (with a dimension equal to m+n by m+n). The network equation becomes:

$\begin{matrix} {\begin{bmatrix} I_{E} \\ 0 \end{bmatrix} = {{Y^{\prime}\begin{bmatrix} E \\ V \end{bmatrix}}.}} & (9) \end{matrix}$

The network equation can be reduced to

I _(E) =YE,  (10)

where Y=Y_(nn)−Y_(nm) Y⁻¹ _(mm)Y_(mn). Numerical evaluation of direct solvers for large sparse, symmetric linear equations could be used to solve Y⁻¹ _(mm)Y_(mn). For each generator internal voltage bus i, the injection current in system reference can be expressed as

$\begin{matrix} {{\overset{\_}{I}}_{(i)}^{sys}\overset{\Delta}{=}{{I_{{re}{(i)}} + {j\; I_{{im}{(i)}}}} = {\sum\limits_{k = 1}^{n}\; {{\overset{\_}{Y}}_{({ik})}{\overset{\_}{E}}_{(k)}}}}} & (11) \end{matrix}$

where a bar above the notation represents a complex number, Ī^(sys) _((i)) is the injection current of bus i in system reference, and Ē(k) is the stator internal voltage of bus k in system reference. Let Ē(k)=E_(re(k))+jE_(im(k)) and Y _((ik))=G_((ik))+jB_((ik)), resolving (11) into real and imaginary part yields,

$\begin{matrix} {{I_{{re}{(i)}} = {\sum\limits_{k = 1}^{n}\; \left\lbrack {{E_{{re}{(k)}}G_{({ik})}} - {E_{{im}{(k)}}B_{({ik})}}} \right\rbrack}},} & \left( {12a} \right) \\ {I_{{im}{(i)}} = {\sum\limits_{k = 1}^{n}\; {\left\lbrack {{E_{{re}{(k)}}B_{({ik})}} - {E_{{im}{(k)}}G_{({ik})}}} \right\rbrack.}}} & \left( {12b} \right) \end{matrix}$

The transformation from machine dq0 reference frame to system reference frame is:

$\begin{matrix} {{\begin{bmatrix} {re} \\ {im} \end{bmatrix} = {\begin{bmatrix} {\sin \; \delta} & {\cos \; \delta} \\ {{- \cos}\; \delta} & {\sin \; \delta} \end{bmatrix}\begin{bmatrix} d \\ q \end{bmatrix}}},} & (13) \end{matrix}$

In classic model, since E′_(d)=0, applying the above transformation to I_(re), I_(im), E_(re), and E_(im) in equation (12) and after manipulations, the following equations are obtained in machine reference frame:

$\begin{matrix} {{0 = {{\sin \; \delta_{(i)}I_{d{(i)}}} + {\cos \; \delta_{(i)}I_{q{(i)}}} - {\sum\limits_{k = 1}^{n}\; \begin{bmatrix} {{\left( {\cos \; \delta_{(k)}E_{q{(k)}}^{\prime}} \right)G_{({ik})}} -} \\ {\left( {\sin \; \delta_{(k)}E_{q{(k)}}^{\prime}} \right)B_{({ik})}} \end{bmatrix}}}},} & \left( {14a} \right) \\ {0 = {{{- \cos}\; \delta_{(i)}I_{d{(i)}}} + {\sin \; \delta_{(i)}I_{q{(i)}}} - {\sum\limits_{k = 1}^{n}\; {\begin{bmatrix} {{\left( {\cos \; \delta_{(k)}E_{q{(k)}}^{\prime}} \right)B_{({ik})}} +} \\ {\left( {\sin \; \delta_{(k)}E_{q{(k)}}^{\prime}} \right)G_{({ik})}} \end{bmatrix}.}}}} & \left( {14b} \right) \end{matrix}$

The active power at air gap can be expressed as:

P _(e(i)) =E′ _(q(i)) I _(q(i)).  (15)

Replacing P_(e(i)) in equation (7) by equation (15) yields:

$\begin{matrix} \left\{ \begin{matrix} {{\overset{.}{\delta}}_{(i)} = {\omega_{b}\omega_{(i)}}} \\ {{\overset{.}{\omega}}_{(i)} = {\frac{1}{2\; H_{(i)}}\left( {P_{m{(i)}} - {E_{q{(i)}}^{\prime}I_{q{(i)}}} - {D_{(i)}\omega_{(i)}}} \right)\left( {16b} \right)}} \end{matrix} \right. & \left( {16a} \right) \end{matrix}$

Combining equation (16) and equation (14) results in a set of differential-algebraic equations (DAE) in the same form as equation (1), where:

x=[δ ₍₁₎,ω₍₁₎, . . . ,δ_((i)),ω_((i)), . . . ,δ_((n)),ω_((n))]^(T),  (17)

y=[I _(d(1)) ,I _(q(1)) , . . . ,I _(d(i)) ,I _(q(i)) , . . . ,I _(d(n)) ,I _(q(n))]^(T),  (18)

and the other notations represent parameters.

Numerical Integration Using Trapezoidal Method

The trapezoidal integration method is used in many time-domain simulation software and can be used to solve the classical model multi-machine system described above.

For time step γ, applying Trapezoidal rule to equation (16) and then combining the resulted algebraic equations with equation (14), yields:

$\quad\begin{matrix} \left\{ \begin{matrix} {0 = {\delta_{({i,\gamma})} - \delta_{({i,{\gamma - 1}})} - {\frac{h}{2}\left( {{\omega_{b}\omega_{({i,{\gamma - 1}})}} + {\omega_{b}\omega_{({i,\gamma})}}} \right)}}} \\ {0 = {\omega_{({i,\gamma})} - \omega_{({i,{\gamma - 1}})} - {{\frac{h}{2}\begin{bmatrix} {{\frac{1}{2\; H_{(i)}}\begin{pmatrix} {P_{m{({i,{\gamma - 1}})}} - {E_{q{(i)}}^{\prime}I_{q{({i,{\gamma - 1}})}}} -} \\ {D_{(i)}\omega_{({i,{\gamma - 1}})}} \end{pmatrix}} +} \\ {\frac{1}{2\; H_{(i)}}\left( {P_{m{({i,\gamma})}} - {E_{q{(i)}}^{\prime}I_{q{({i,\gamma})}}} - {D_{(i)}\omega_{({i,\gamma})}}} \right)} \end{bmatrix}}\left( {19b} \right)}}} \\ {0 = {{\sin \; \delta_{({i,\gamma})}I_{d{({i,\gamma})}}} + {\cos \; \delta_{({i,\gamma})}I_{q{({i,\gamma})}}} - {\sum\limits_{k = 1}^{n}\; {\begin{bmatrix} {{\left( {\cos \; \delta_{({k,\gamma})}E_{q{(k)}}^{\prime}} \right)G_{({i,k})}} -} \\ {\left( {\sin \; \delta_{({k,\gamma})}E_{q{(k)}}^{\prime}} \right)B_{({i,k})}} \end{bmatrix}\left( {19c} \right)}}}} \\ {0 = {{{- \cos}\; \delta_{({i,\gamma})}I_{d{({i,\gamma})}}} + {\sin \; \delta_{({i,\gamma})}I_{q{({i,\gamma})}}} - {\sum\limits_{k = 1}^{n}\; {\begin{bmatrix} {{\left( {\cos \; \delta_{({k,\gamma})}E_{q{(k)}}^{\prime}} \right)B_{({i,k})}} +} \\ {\left( {\sin \; \delta_{({k,\gamma})}E_{q{(k)}}^{\prime}} \right)G_{({i,k})}} \end{bmatrix}\left( {19d} \right)}}}} \end{matrix} \right. & \left( {19a} \right) \end{matrix}$

where h is the integration step length. The first two are corresponding to equations in F in equation (4); the last two are corresponding to equations in g in equation (3). Combining these equations results in:

$\begin{matrix} {{{0 = {{H\left( {x_{\gamma},y_{\gamma}} \right)} = \begin{bmatrix} {F_{1}\left( {x_{\gamma},y_{\gamma}} \right)} \\ {F_{2}\left( {x_{\gamma},y_{\gamma}} \right)} \\ \ldots \\ {g_{1}\left( {x_{\gamma},y_{\gamma}} \right)} \\ {g_{2}\left( {x_{\gamma},y_{\gamma}} \right)} \\ \ldots \end{bmatrix}}},{where}}{x_{\gamma} = \left\lbrack {\delta_{({1,\gamma})},\omega_{({1,\gamma})},\ldots \mspace{14mu},\delta_{({i,\gamma})},\omega_{({i,\gamma})},\ldots \mspace{14mu},\delta_{({n,\gamma})},\omega_{({n,\gamma})}} \right\rbrack^{T}}{and}{y_{\gamma} = {\left\lbrack {I_{d{({1,\gamma})}},I_{q{({1,\gamma})}},\ldots \mspace{14mu},{I_{d}}_{({i,\gamma})},{I_{q}}_{({i,\gamma})},\ldots \mspace{14mu},{I_{d}}_{({n,\gamma})},{I_{q}}_{({n,\gamma})}} \right\rbrack.}}} & (20) \end{matrix}$

Both Newton and Gauss methods can be used to solve the equations.

1) Newton: In order to solve the equation using Newton method, one needs to find the Jacobian Matrix first. The Jacobian matrix of equation (6), restated here for convenience, is:

$\begin{matrix} {J = {\begin{bmatrix} J_{Fx} & J_{Fy} \\ J_{gx} & J_{gy} \end{bmatrix}.}} & (21) \end{matrix}$

Each sub-matrix is calculated below:

$\begin{matrix} {J_{Fx} = {{{{diag}\left( J_{Fx}^{i} \right)}\mspace{14mu} {and}\mspace{14mu} J_{Fx}^{i}} = {\begin{bmatrix} 1 & {{- h}\; {\omega_{b}/2}} \\ 0 & {1 + {{hD}_{(i)}/\left( {4\; H_{(i)}} \right)}} \end{bmatrix}.}}} & (22) \\ {J_{Fy} = {{{{diag}\left( J_{Fy}^{i} \right)}\mspace{14mu} {and}\mspace{14mu} J_{Fy}^{i}} = {\begin{bmatrix} 0 & 0 \\ 0 & {{hE}_{q{(i)}}^{\prime}/\left( {4\; H_{(i)}} \right)} \end{bmatrix}.}}} & (23) \\ {{J_{gx}\mspace{31mu} J_{gx}} = \begin{bmatrix} J_{{gx}{(11)}} & J_{{gx}{(12)}} & \ldots & J_{{gx}{({1\; n})}} \\ J_{{gx}{(21)}} & J_{{gx}{(22)}} & \ldots & J_{{gx}{({2\; n})}} \\ \vdots & \vdots & \ddots & \vdots \\ J_{{gx}{({n\; 1})}} & J_{{gx}{({n\; 2})}} & \ldots & J_{{gx}{({nn})}} \end{bmatrix}} & (24) \\ {J_{{gx}{({ii})}} = {\begin{bmatrix} \begin{matrix} {{I_{d{({i,\gamma})}}\cos \; \delta_{({i,\gamma})}} - {I_{q{({i,\gamma})}}\sin \; \delta_{({i,\gamma})}} +} \\ {{G_{({ii})}E_{q{(i)}}^{\prime}\sin \; \delta_{({i,\gamma})}} + {B_{({i,i})}E_{q{(i)}}^{\prime}\cos \; \delta_{({i,\gamma})}}} \end{matrix} & 0 \\ \begin{matrix} {{I_{d{({i,\gamma})}}\sin \; \delta_{({i,\gamma})}} + {I_{q{({i,\gamma})}}\cos \; \delta_{({i,\gamma})}} +} \\ {{B_{({ii})}E_{q{(i)}}^{\prime}\sin \; \delta_{({i,\gamma})}} - {G_{({i,i})}E_{q{(i)}}^{\prime}\cos \; \delta_{({i,\gamma})}}} \end{matrix} & 0 \end{bmatrix}.}} & (25) \\ {J_{{gx}{({ik})}} = {\begin{bmatrix} {{G_{({i,k})}E_{q{(k)}}^{\prime}\sin \; \delta_{({k,\gamma})}} + {B_{({i,k})}E_{q{(k)}}^{\prime}\cos \; \delta_{({k,\gamma})}}} & 0 \\ {{B_{({i,k})}E_{q{(k)}}^{\prime}\sin \; \delta_{({k,\gamma})}} - {G_{({i,k})}E_{q{(k)}}^{\prime}\cos \; \delta_{({k,\gamma})}}} & 0 \end{bmatrix}.}} & (26) \\ {J_{gy} = {{{{diag}\left( J_{gy}^{i} \right)}\mspace{14mu} {and}\mspace{14mu} J_{gy}^{i}} = {\begin{bmatrix} {\sin \; \delta_{({i,\gamma})}} & {\cos \; \delta_{({i,\gamma})}} \\ {{- \cos}\; \delta_{({i,\gamma})}} & {\sin \; \delta_{({i,\gamma})}} \end{bmatrix}.}}} & (27) \end{matrix}$

Similarly, one can find the analytical expression of Jacobian matrix when higher order machine model and dynamic load model are used. Among the reviewed the references, no one suggests that there exists any difficulty to find the analytical expression of Jacobian matrix. The method to find Jacobian matrix in general case (rather than classic machine model and constant impedance) is described in equation [6]. In equations [26] and [27], the analytical expression of the Jacobian matrix is provided when transient machine model, exciter model, and dynamic load model are used.

2) Gauss: Rearranging equation (19) in the form:

X _(γ) =G(X _(γ)),  (28)

the equation can be directly solved using Gauss or Gauss-Seidel method.

Time Stacking Method—Parallel in Time

In this method, in one embodiment, the equations in (20) are combined to form a large set of algebraic equations:

$\begin{matrix} \left\{ \begin{matrix} {0 = {H\left( {x_{\gamma},y_{\gamma}} \right)}} \\ {0 = {H^{\prime}\left( {x_{\gamma},y_{\gamma},x_{\gamma + 1},y_{\gamma + 1}} \right)}} \\ \ldots \\ {0 = {H^{\prime}\left( {x_{\gamma + p - 2},y_{\gamma + p - 2},x_{\gamma + p - 1},y_{\gamma + p - 1}} \right)}} \end{matrix} \right. & (29) \end{matrix}$

where p represents the number of time steps in parallel, and H and H′ are comprised of equations similar to (19). In H, the previous time step variables are known and the only unknown are the current time step variables. In H′, variables of two future adjacent time steps are unknown. The variables to be determined are:

[(x _(γ) ,y _(γ)),(x _(γ+1) ,y _(γ+1)), . . . ,(x _(γ+p−1) ,y _(γ+p−1))].

This equation set can be solved similarly as a conventional one-step approach. The corresponding Jacobian matrix is

$\begin{matrix} {\Lambda = \begin{bmatrix} J_{\gamma} & 0 & \ldots & 0 & 0 \\ J_{({{\gamma + 1},\gamma})} & J_{\gamma + 1} & \ldots & 0 & 0 \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & \ldots & J_{({{\gamma + p - 1},{\gamma + p - 2}})} & J_{\gamma + p - 1} \end{bmatrix}} & (30) \end{matrix}$

where the diagonal sub-matrix is shown in equation (21). In the subscript of the off-diagonal matrix, the first number represents the equation set index, and the second number represents variable set index.

$\begin{matrix} {{J_{({{j + 1},i})} = \begin{bmatrix} J_{F_{j + 1}x_{j}} & J_{F_{j + 1}y_{j}} \\ 0 & 0 \end{bmatrix}},} & (31) \end{matrix}$

where j=γ, γ+1, . . . , γ+p−2. Each sub-matrix is calculated below:

$\begin{matrix} {\mspace{79mu} {{J_{F_{j + 1}x_{j}} = {{diag}\left( J_{F_{j + 1}x_{j}}^{i} \right)}}\mspace{20mu} {and}\mspace{20mu} {J_{F_{j + 1}x_{j}}^{i} = {\begin{bmatrix} {- 1} & {{- h}\; {\omega_{b}/2}} \\ 0 & {{- 1} + {{hD}_{(i)}/\left( {4\; H_{(i)}} \right)}} \end{bmatrix}.}}}} & (32) \\ {\mspace{79mu} {{J_{F_{j + 1}y_{j}} = {{diag}\left( J_{F_{j + 1}y_{j}}^{i} \right)}}\mspace{20mu} {and}\mspace{20mu} {J_{F_{j + 1}y_{j}}^{i} = {{\begin{bmatrix} 0 & 0 \\ 0 & {h{\text{?}/\left( {4\; H_{(i)}} \right)}} \end{bmatrix}.\text{?}}\text{indicates text missing or illegible when filed}}}}} & (33) \end{matrix}$

Numerical integration methods can be categorized by two attributes: 1) single-step or multi-step; 2) explicit or implicit.

1) Single-step methods only utilize one previous point and its derivative to determine the value at current step. On the other hand, multi-step methods express the value at current step as a function of the previous points and their derivative values. Runge-Kutta (RK) methods are the most famous family of single-step methods, while Adams family is the best known multi-step methods.

2) Explicit methods evaluate the value of current step explicitly as a function of values at previous steps, while implicit methods expresses the value at current step as a function of values at both current and previous steps.

Runge-Kutta and Adams (both explicit and implicit) methods will be briefly described below.

A. Runge-Kutta Methods

For an ordinary differential equation {dot over (x)}=f(x), RK methods have the form:

$\begin{matrix} {x_{n + 1} = {x_{n} + {\sum\limits_{i = 1}^{s}\; {b_{i}K_{i,}}}}} & (34) \end{matrix}$

The Butcher tableaus for explicit and implicit RK methods are shown in FIGS. 3A and 3B, respectively.

1) Examples of Explicit RK Methods:

-   -   Forward Euler is the simplest explicit RK method with s=1 and         b1=1. Its formula is x_(n+1)=x_(n)+hf(x_(n)).     -   One of the family of Runge-Kutta methods is so commonly used         that it is often referred to as “RK4”, “classical Runge-Kutta”,         or simply as “the Runge-Kutta method”. Its Butcher tableau is         shown in FIG. 4.

2) Examples of Implicit RK Methods:

-   -   The simplest example of an implicit RK method is the backward         Euler method.     -   Trapezoidal method is the second order implicit RK method.

B. Adams Methods

Adams methods have the form:

$\begin{matrix} {{\sum\limits_{k = 0}^{s}\; {\alpha_{k}x_{n + k}}} = {h{\sum\limits_{k = 0}^{s}{\beta_{k}{{f\left( x_{n + k} \right)}.}}}}} & (35) \end{matrix}$

For Adams-Bashforth (explicit Adams methods), β=0; for Adams-Moulton (implicit Adams methods), β≠0.

Multi-step methods attempt to gain efficiency by keeping and using the information from previous steps rather than discarding it. For example, the formula of two-step Adams-Bashforth method is

$\begin{matrix} \begin{matrix} {x_{n + 1} = {x_{n} + {\frac{h}{2}\left\lbrack {{3\; {f\left( x_{n} \right)}} - {f\left( x_{n - 1} \right)}} \right\rbrack}}} \\ {= {x_{n} + {{hf}\left( x_{n} \right)} + {\frac{h^{2}}{2}\underset{\underset{{f^{\prime}{(x_{n})}} + {O{(h)}}}{}}{\frac{{f\left( x_{n} \right)} - {f\left( x_{n - 1} \right)}}{h}}}}} \\ {= {x_{n} + {{hf}\left( x_{n} \right)} + {\frac{h^{2}}{2}{f^{\prime}\left( x_{n} \right)}} + {{O\left( h^{3} \right)}.}}} \end{matrix} & (36) \end{matrix}$

Therefore, two-step Adams-Bashforth is equivalent to considering up to the second derivative term in the Taylor series. It should be noted that idea of multi-step integration methods is not approximating the first-order derivative at current step by combination of first-order derivative at previous steps. Instead, the method utilizes the information at previous steps to obtain a higher order approximation of Taylor series. One disadvantage of multi-step methods is the integration process has to be restarted whenever a discontinuity occurs.

Forward Euler, backward Euler, and Trapezoidal methods are degenerate cases of Adams methods, which only utilize one previous point and its derivate to determine the value at a current step.

Numerical Instability and Hyper-Stability

A numerical integration method is chosen so that:

-   -   if the continuous system is stable, the discrete time system is         also stable.     -   if the continuous time system is unstable, the discrete time         system is also unstable.

However, an integration method may create numerical instability, i.e., the continuous time system is stable, but the discrete time system is unstable. On the other hand, an integration method may also create hyper-stability, i.e., the continuous time system is unstable, but the discrete time is stable. Forward Euler, backward Euler, and Trapezoidal methods will be used to explain the idea of the above concepts.

A. Forward Euler

Let H(s) and H(z) denote the s-domain (corresponding to continuous time) and z-domain (corresponding to discrete time) transfer functions, respectively. Let s_(p)=σ_(p)+jω_(p) denote a pole of H(s). The continuous time system is stable if σ_(p)<0, for all the poles of H(s). The discrete system is stable when |z_(p)|<1 for all the poles of H(z). The z-domain transfer function using forward Euler integration can be obtained by

$\begin{matrix} {{H(z)} = \left. {H(s)} \middle| {}_{s = \frac{x - 1}{h}}. \right.} & (37) \end{matrix}$

The poles of H(z) can be obtained by z_(p)=1+hs_(p).

When the continuous system is unstable, i.e., there exists at least one pole with σ_(p)>0, then:

|z _(p)|=√{square root over ((1+hσ _(p))²+(hω _(p))²)}{square root over ((1+hσ _(p))²+(hω _(p))²)}≦1, ∀h≦0.  (38)

Therefore the discrete system is unstable, which means forward Euler does not create hyper-stability.

When the continuous system is stable, i.e., σ_(p)<0 for all the poles H(s), then:

$\begin{matrix} {{{\begin{matrix} {{z_{p}} = \sqrt{\left( {1 + {h\; \sigma_{p}}} \right)^{2} + \left( {h\; \omega_{p}} \right)^{2}}} \\ {= \sqrt{1 + {{h\left( {\sigma_{p}^{2} + \omega_{p}^{2}} \right)}\left( {h + \frac{2\; \sigma_{p}}{\sigma_{p}^{2} + \omega_{p}^{2}}} \right)}}} \end{matrix} > 1},{when}}{{h > {\frac{{- 2}\; \sigma_{p}}{\sigma_{p}^{2} + \omega_{p}^{2}}\left( {{i.e.},{{{1 + {hs}_{p}}} > 1}} \right)}},}} & (39) \end{matrix}$

which means when integration step length h is not small enough, forward Euler will cause numerical instability.

Defining R(hs)

R as stability function of integration method, then the stability domain is

S={μεC,|R(μ)|≦1}.  (40)

The stability function of forward Euler is

R(μ)=1+μ.  (41)

Its stability domain is shown in FIG. 5A.

B. Backward Euler

The stability function of backward Euler is

$\begin{matrix} {{R(\mu)} = {\frac{1}{1 - \mu}.}} & (42) \end{matrix}$

Its stability domain is shown in FIG. 5B.

When the continuous system is stable, i.e., σ_(p)<0 for all the poles of H(s), μ falls in the stability region for any integration time step length. Therefore, the discrete time system is stable, which means backward Euler method does not create numerical instability.

When the continuous system is unstable, i.e., there exists at least one pole with σ_(p)>0, the corresponding μ_(p)=hs_(p) falls in the stability region when h>2σ_(p)/(σ² _(p)+w² _(p)) (i.e., |h s_(p)−1|>1), which means the discrete time system is stable. Therefore, backward Euler may create hyper-stability.

C. Trapezoidal

The stability function of forward Euler is

$\begin{matrix} {{R(\mu)} = {\frac{1 + {\mu/2}}{1 - {\mu/2}}.}} & (43) \end{matrix}$

Its stability domain is shown in FIG. 5C. As can be seen, the stability property of the discrete time system is exactly the same as the continuous time system for all the time step length, i.e., the Trapezoidal method avoids both numerical instability and hyper-stability.

Classical Model with Modified Euler Method

The variables used in the code and the corresponding notation herein are listed in the table of FIG. 6. The equations are provided based on which existing code is developed.

A. Equations Translated Back from Existing Code

For each generator at time step 1 (main):

$\begin{matrix} \; & \left. {GEN}_{{MVA}{(i)}}\leftarrow\frac{S_{MVA}}{{GEN}_{{MVA}{(i)}}} \right. & \; \\ \; & {\overset{\_}{V} = {E_{T{(i)}}^{j\; \theta_{(i)}}}} & \; \\ {I = {{\sqrt{P_{e{({i,1})}}^{2} + Q_{e{(i)}}^{2}}/E_{T{(i)}}} \times}} & {\varphi = {\tan^{- 1}\left( \frac{Q_{e{(i)}}}{P_{e{({i,1})}}} \right)}} & {\overset{\_}{I} = {I\; ^{j{({\theta_{(i)} - \varphi})}}}} \\ {GEN}_{{MVA}{(i)}} & \; & \; \\ {\overset{\_}{E} = {{\overset{\_}{V}{+ {\,{jX}_{d{(i)}}^{\prime}}}}\overset{\_}{I}}} & {E_{im} = {{imag}\left( \overset{\_}{E} \right)}} & {E_{re} = {{real}\left( \overset{\_}{E} \right)}} \\ {{\delta_{({i,1})} = {\tan^{- 1}\left( \frac{{imag}\left( \overset{\_}{E} \right)}{{real}\left( \overset{\_}{E} \right)} \right)}}\;} & {\omega_{({i,1})}^{p} = 1} & \; \\ \; & { = {{j}^{- {j\delta}_{({i,1})}}\overset{\Delta}{=}^{j{({{90{^\circ}} - \delta_{({i,1})}})}}}} & \; \\ {{\overset{\_}{E}}^{\prime} = {\overset{\_}{E}\; }} & {E_{d{({i,1})}}^{\prime} = {{real}\left( E^{\prime} \right)}} & {E_{q{({i,1})}}^{\prime} = {{imag}\left( E^{\prime} \right)}} \\ \left. \overset{\_}{I}\leftarrow{\overset{\_}{I}\; } \right. & {I_{{dg}{(i)}} = {{real}(I)}} & {I_{{qg}{(i)}} = {{imag}(I)}} \\ \; & {I_{d{(i)}} = {{{real}(I)}/{GEN}_{{MVA}{(i)}}}} & {I_{q{(i)}} = {{{imag}(I)}/}} \\ \; & \; & {GEN}_{{MVA}{(i)}} \\ \left. \overset{\_}{V}\leftarrow{\overset{\_}{V}\; } \right. & {E_{d{(i)}} = {{real}\left( \overset{\_}{V} \right)}} & {E_{q{(i)}} = {{imag}\left( \overset{\_}{V} \right)}} \\ \; & {V_{{ex}{(i)}} = E_{q{({i,1})}}^{\prime}} & \; \\ \; & {P_{m{({i,1})}} = {P_{e{({i,1})}}{GEN}_{{MVA}{(i)}}}} & \; \end{matrix}$

For each time step γ, for each generator i:

P _(m(i,γ+1)) =P _(m(i,γ))

mac_em1 (machine to system reference frame):

E _(re(i,γ))=sin δ_((i,γ)) E′ _(d(i,γ))+cos δ_((i,γ)) E′ _(q(i,γ))

real[ E′ _((i,γ)) /R _((i,γ))]

E _(im(i,γ))=−cos δ_((i,γ)) E′ _(d(i,γ))+sin δ_((i,γ)) E′ _(q(i,γ))

imag[ E′ _((i,γ)) /R _((i,γ))]

After terminal voltage Ē(_(i,γ)) is obtained for all the buses, for each generator i:

i_simu_innerloop2 (system reference frame):

${\overset{\_}{I}}_{({i,\gamma})} = {\sum\limits_{k}\; {{\overset{\_}{Y}}_{({ik})}{\overset{\_}{E}}_{({k,\gamma})}}}$ $I_{{re}{({i,\gamma})}} = {{real}\left\lbrack {\overset{\_}{I}}_{({i,\gamma})} \right\rbrack}$ $I_{{im}{({i,\gamma})}} = {{imag}\left\lbrack {\overset{\_}{I}}_{({i,\gamma})} \right\rbrack}$

mac_em2 (system to machine reference frame):

$\left. \mspace{79mu} {{I_{d{(i)}} = {{{\sin \; \delta_{({i,\gamma})}I_{{re}{({i,\gamma})}}} - {\cos \; \delta_{({i,\gamma})}I_{{im}{({i,\gamma})}}}}\overset{\Delta}{=}{{real}\left\lbrack {{\overset{\_}{I}}_{({i,\gamma})}_{({i,\gamma})}} \right\rbrack}}}\mspace{79mu} {I_{q{(i)}} = {{{\cos \; \delta_{({i,\gamma})}I_{{re}{({i,\gamma})}}} + {\sin \; \delta_{({i,\gamma})}I_{{im}{({i,\gamma})}}}}\overset{\Delta}{=}{{imag}\left\lbrack {{\overset{\_}{I}}_{({i,\gamma})}_{({i,\gamma})}} \right\rbrack}}}\begin{matrix} {I_{{dg}{(i)}} = {I_{d{(i)}}{GEN}_{{MVA}{(i)}}}} & {I_{{qg}{(i)}} = {I_{q{(i)}}{GEN}_{{MVA}{(i)}}}} & \; \\ {E_{d{(i)}} = {E_{d{({i,\gamma})}}^{\prime} +}} & {E_{q{(i)}} = {E_{q{({i,\gamma})}}^{\prime} -}} & {E_{T{(i)}} = \sqrt{E_{d{(i)}}^{2} + E_{q{(i)}}^{2}}} \\ {X_{d{(i)}}^{\prime}I_{{qg}{(i)}}} & {X_{d{(i)}}^{\prime}I_{{dg}{(i)}}} & \; \\ {P_{e{({i,\gamma})}} = {{E_{q{(i)}}I_{q{(i)}}} +}} & {Q_{e{({i,\gamma})}} = {{E_{q{(i)}}I_{d{(i)}}} -}} & \; \\ {E_{d{(i)}}I_{d{(i)}}} & {E_{d{(i)}}I_{q{(i)}}} & \; \\ \; & {E_{d{({i,{\gamma + 1}})}}^{\prime} = E_{d{({i,\gamma})}}^{\prime}} & {E_{q{({i,{\gamma + 1}})}}^{\prime} = E_{q{({i,\gamma})}}^{\prime}} \\ \; & {{\overset{.}{\delta}}_{({i,\gamma})} = {\omega_{b}\left\lbrack {\omega_{({i,\gamma})}^{p} - 1} \right\rbrack}} & \; \end{matrix}\mspace{85mu} {{\overset{.}{\omega}}_{({i,\gamma})}^{p} = {\frac{1}{2\; H_{(i)}}\left\lbrack {P_{m{({i,\gamma})}} - {P_{e{({i,\gamma})}}{GEN}_{{MVA}{(i)}}} - {D_{(i)}\left( {\omega_{({i,\gamma})}^{p} - 1} \right)}} \right\rbrack}}\mspace{79mu} {S_{e{(i)}} = {\left\lbrack {E_{d{(i)}} + {j\; E_{q{(i)}}}} \right\rbrack \left\lbrack {I_{d{(i)}} - {j\; I_{q{(i)}}}} \right\rbrack}}} \right)\overset{\Delta}{=}{\left( {\overset{\_}{V}\; } \right)\left( {\overset{\_}{I}\; } \right)^{*}}$ $\begin{matrix} {\mspace{79mu} {{\overset{\_}{V}\; } = {E_{d} + {j\; E_{q}}}}} \\ {= {\left( {E_{d}^{\prime} + {X_{d}^{\prime}I_{qg}}} \right) + {j\left( {E_{q}^{\prime} - {X_{d}^{\prime}I_{dg}}} \right)}}} \\ {= {\left( {E_{d}^{\prime} + {j\; E_{q}^{\prime}}} \right) - {j\; {X_{d}^{\prime}\left( {I_{qg} + {j\; I_{dg}}} \right)}}}} \\ {= {{{\overset{\_}{E}}^{\prime}\; } - {j\; X_{d}^{\prime}{\overset{\_}{I}}_{g}}}} \end{matrix}$

B. A “Clean” but Equivalent Version of Equations

For each generator at time step 1 (main):

$\begin{matrix} \; & \left. {GEN}_{{MVA}{(i)}}\leftarrow\frac{S_{MVA}}{{GEN}_{{MVA}{(i)}}} \right. & \; \\ \; & \left. D_{(i)}\leftarrow\frac{D_{(i)}}{{GEN}_{{MVA}{(i)}}} \right. & \; \\ \; & \left. H_{(i)}\leftarrow\frac{H_{(i)}}{{GEN}_{{MVA}{(i)}}} \right. & \; \\ \; & {\overset{\_}{V} = {E_{T{(i)}}^{j\; \theta_{(i)}}}} & \; \\ {I = {{\sqrt{P_{e{({i,1})}}^{2} + Q_{e{(i)}}^{2}}/E_{T{(i)}}} \times}} & {\varphi = {\tan^{- 1}\left( \frac{Q_{e{(i)}}}{P_{e{({i,1})}}} \right)}} & {\overset{\_}{I} = {I\; ^{j({\theta_{(i)} - \varphi})}}} \\ {GEN}_{{MVA}{(i)}} & \; & \; \\ \; & {\overset{\_}{E} = {\overset{\_}{V} + {j\; X_{d{(i)}}^{\prime}\overset{\_}{I}}}} & \; \\ {\delta_{({i,1})} = {\tan^{- 1}\left( \frac{{imag}\left( \overset{\_}{E} \right)}{{real}\left( \overset{\_}{E} \right)} \right)}} & {\omega_{({i,1})} = 0} & \; \\ \; & {E_{q{(i)}} = {E_{({i,1})}}} & \; \\ \; & {P_{m{({i,1})}} = {P_{e{({i,1})}}}} & \; \end{matrix}$

For each time step γ, for each generator i:

P _(m(i,γ+1)) =P _(m(i,γ))

mac_em1 (machine to system reference frame):

E _(re(i,γ))=cos δ_((i,γ)) E′ _(q(i))

E _(im(i,γ))=sin δ_((i,γ)) E′ _(q(i))

After terminal voltage Ē(_(i,γ)) is obtained for all the buses, for each generator i:

i_simu_innerloop2 (system reference frame):

${\overset{\_}{I}}_{({i,\gamma})} = {\sum\limits_{k}\; {{\overset{\_}{Y}}_{({ik})}{\overset{\_}{E}}_{({k,\gamma})}}}$ $I_{{re}{({i,\gamma})}} = {{real}\left\lbrack {\overset{\_}{I}}_{({i,\gamma})} \right\rbrack}$ $I_{{im}{({i,\gamma})}} = {{imag}\left\lbrack {\overset{\_}{I}}_{({i,\gamma})} \right\rbrack}$

mac_em2 (system to machine reference frame):

I_(q(i)) = cos  δ_((i, γ))I_(re(i, γ)) + sin  δ_((i, γ))I_(im(i, γ)) P_(e(i, γ)) = E_(q(i))^(′)I_(q(i)) ${\overset{.}{\delta}}_{({i,\gamma})} = {\omega_{b}\omega_{({i,\gamma})}}$ ${\overset{.}{\omega}}_{({i,\gamma})} = {\frac{1}{2\; H_{(i)}}\left\lbrack {P_{m{({i,\gamma})}} - {P_{e{({i,\gamma})}}} - {D_{(i)}\omega_{({i,\gamma})}}} \right\rbrack}$ ω_((i, γ))^(p) = ω_((i, γ)) + 1

In compliance with the statute, embodiments of the invention have been described in language more or less specific as to structural and methodical features. It is to be understood, however, that the entire invention is not limited to the specific features and/or embodiments shown and/or described, since the disclosed embodiments comprise forms of putting the invention into effect. 

We claim:
 1. A time-stacking method of simulating dynamics of a system so as to obtain time-domain trajectories which correspond to a disturbance or event, comprising: a. providing a model for the system, wherein the model includes differential equations and algebraic equations; and b. solving the differential equations and the algebraic equations over a predetermined number of time steps simultaneously using an implicit integration scheme.
 2. The method of claim 1 further comprising applying a numerical solver to compute a final result of the equations.
 3. The method of claim 2 further comprising applying a supercomputer or high-performance computer for solving the equations simultaneously in parallel.
 4. The method of claim 1 wherein the implicit integration scheme comprises at least one of the following: Backward Euler, Trapezoidal, Runge-Kutta, Newton, and Dishonest Newton.
 5. The method of claim 1 wherein the differential equations represent vectors of state variables and the algebraic equations represent vectors of algebraic variables.
 6. The method of claim 5 wherein the vectors of state variables include generator dynamics.
 7. The method of claim 6 wherein the generator dynamics include rotor angle and generator speed.
 8. The method of claim 5 wherein the vectors of algebraic variables include voltages from selected buses in a network and current injections from generators or loads, expressed as magnitudes and phase angles, or real and imaginary parts.
 9. The method of claim 1 wherein the time steps comprise intervals of at least 1 microsecond.
 10. The method of claim 9 wherein the time steps of intervals vary over a range of at least 1 microsecond so as to obtain a calculation that corresponds to the disturbance or event.
 11. A method of simulating power system dynamics of a system so as to obtain time-domain trajectories which correspond to a disturbance or event, comprising: a. providing a model for the system, wherein the model includes differential equations and algebraic equations; b. solving the differential equations and the algebraic equations over a predetermined number of time steps simultaneously using an implicit integration scheme; c. applying a numerical solver to compute a final result of the equations; and d. applying a supercomputer or high-performance computer for solving the equations simultaneously.
 12. The method of claim 11 wherein the implicit integration scheme comprises at least one of the following: Backward Euler, Trapezoidal, Runge-Kutta, Newton, and Dishonest Newton.
 13. The method of claim 11 wherein the differential equations represent vectors of state variables and the algebraic equations represent vectors of algebraic variables.
 14. The method of claim 13 wherein the vectors of state variables include generator dynamics.
 15. The method of claim 14 wherein the generator dynamics include rotor angle and generator speed.
 16. The method of claim 13 wherein the vectors of algebraic variables include voltages from selected buses in a network and current injections from generators or loads, expressed as magnitudes and phase angles, or real and imaginary parts.
 17. The method of claim 11 wherein the time steps comprise intervals of at least 1 microsecond.
 18. The method of claim 17 wherein the time steps of intervals vary over a range of at least 1 microsecond so as to obtain a calculation that corresponds to the disturbance or event. 